/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "vendertransaction")
@XmlRootElement(name = "vendertransaction")
@NamedQueries({
    @NamedQuery(name = "Vendertransaction.findAll", query = "SELECT v FROM Vendertransaction v"),
    @NamedQuery(name = "Vendertransaction.findByVenderTransactionID", query = "SELECT v FROM Vendertransaction v WHERE v.venderTransactionID = :venderTransactionID"),
    @NamedQuery(name = "Vendertransaction.findByAmount", query = "SELECT v FROM Vendertransaction v WHERE v.amount = :amount"),
    @NamedQuery(name = "Vendertransaction.findByDatetime", query = "SELECT v FROM Vendertransaction v WHERE v.datetime = :datetime"),
    @NamedQuery(name = "Vendertransaction.findByDescription", query = "SELECT v FROM Vendertransaction v WHERE v.description = :description"),
    @NamedQuery(name = "Vendertransaction.findByDiscountamount", query = "SELECT v FROM Vendertransaction v WHERE v.discountamount = :discountamount"),
    @NamedQuery(name = "Vendertransaction.findByIsdeleted", query = "SELECT v FROM Vendertransaction v WHERE v.isdeleted = :isdeleted")})
public class Vendertransaction implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "VenderTransactionID")
    private Long venderTransactionID;
    @Column(name = "amount")
    private Long amount;
    @Column(name = "datetime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date datetime;
    @Column(name = "description")
    private String description;
    @Column(name = "discountamount")
    private Double discountamount;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @JoinColumn(name = "Tax_TaxID", referencedColumnName = "TaxID")
    @ManyToOne(optional = false)
    private Tax tax;
    @JoinColumn(name = "paymentmode_PaymentmodeID", referencedColumnName = "PaymentmodeID")
    @ManyToOne(optional = false)
    private Paymentmode paymentmode;
    @JoinColumn(name = "discountype_DiscounttypeID", referencedColumnName = "DiscounttypeID")
    @ManyToOne(optional = false)
    private Discountype discountype;
    @JoinColumn(name = "transactiontype_TransactiontypeID", referencedColumnName = "TransactiontypeID")
    @ManyToOne(optional = false)
    private Transactiontype transactiontype;

    public Vendertransaction() {
    }

    public Vendertransaction(Long venderTransactionID) {
        this.venderTransactionID = venderTransactionID;
    }

    public Long getVenderTransactionID() {
        return venderTransactionID;
    }

    public void setVenderTransactionID(Long venderTransactionID) {
        this.venderTransactionID = venderTransactionID;
    }

    public Long getAmount() {
        return amount;
    }

    public void setAmount(Long amount) {
        this.amount = amount;
    }

    public Date getDatetime() {
        return datetime;
    }

    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Double getDiscountamount() {
        return discountamount;
    }

    public void setDiscountamount(Double discountamount) {
        this.discountamount = discountamount;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Tax getTax() {
        return tax;
    }

    public void setTax(Tax tax) {
        this.tax = tax;
    }

    public Paymentmode getPaymentmode() {
        return paymentmode;
    }

    public void setPaymentmode(Paymentmode paymentmode) {
        this.paymentmode = paymentmode;
    }

    public Discountype getDiscountype() {
        return discountype;
    }

    public void setDiscountype(Discountype discountype) {
        this.discountype = discountype;
    }

    public Transactiontype getTransactiontype() {
        return transactiontype;
    }

    public void setTransactiontype(Transactiontype transactiontype) {
        this.transactiontype = transactiontype;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (venderTransactionID != null ? venderTransactionID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Vendertransaction)) {
            return false;
        }
        Vendertransaction other = (Vendertransaction) object;
        if ((this.venderTransactionID == null && other.venderTransactionID != null) || (this.venderTransactionID != null && !this.venderTransactionID.equals(other.venderTransactionID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Vendertransaction[venderTransactionID=" + venderTransactionID + "]";
    }

}
